package com.thermofisher.dsc.amanda.common.util;

import java.util.Date;
import org.joda.time.DateTime;

/**
 * @author wenjie.yang on 1/8/2019.
 */
public class TimeUtils {


  public static Date minusYear(Date date,int year){
    DateTime dateTime = new DateTime(date);
    return dateTime.minusYears(year).toDate();
  }

  public static String formateDate(Date date,String formate){
    DateTime dateTime = new DateTime(date);
    return dateTime.toString(formate);
  }




}
